1 % Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
3 {\ttfamily \raggedright {
5 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$iostream$>$
}} \\
7 \mbox{}\textbf{\textcolor{Blue
}{const
}}\
\textcolor{ForestGreen
}{int
}\ SIZE\
\textcolor{BrickRed
}{=
}\
\textcolor{Purple
}{1000000}\textcolor{BrickRed
}{;
} \\
9 \mbox{}\textit{\textcolor{Brown
}{//criba
[i
]\ =\ false\ si\ i\ es\ primo
}} \\
10 \mbox{}\textcolor{ForestGreen
}{bool
}\ criba
\textcolor{BrickRed
}{[}SIZE
\textcolor{BrickRed
}{+
}\textcolor{Purple
}{1}\textcolor{BrickRed
}{];
} \\
12 \mbox{}\textcolor{ForestGreen
}{void
}\
\textbf{\textcolor{Black
}{buildCriba
}}\textcolor{BrickRed
}{()
}\textcolor{Red
}{\
{} \\
13 \mbox{}\ \
\textbf{\textcolor{Black
}{memset
}}\textcolor{BrickRed
}{(
}criba
\textcolor{BrickRed
}{,
}\
\textbf{\textcolor{Blue
}{false
}}\textcolor{BrickRed
}{,
}\
\textbf{\textcolor{Blue
}{sizeof
}}\textcolor{BrickRed
}{(
}criba
\textcolor{BrickRed
}{));
} \\
15 \mbox{}\ \ criba
\textcolor{BrickRed
}{[}\textcolor{Purple
}{0}\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{=
}\ criba
\textcolor{BrickRed
}{[}\textcolor{Purple
}{1}\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{=
}\
\textbf{\textcolor{Blue
}{true
}}\textcolor{BrickRed
}{;
} \\
16 \mbox{}\ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ i
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{4}\textcolor{BrickRed
}{;
}\ i
\textcolor{BrickRed
}{$<$=
}SIZE
\textcolor{BrickRed
}{;
}\ i\
\textcolor{BrickRed
}{+=
}\
\textcolor{Purple
}{2}\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
17 \mbox{}\ \ \ \ criba
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{=
}\
\textbf{\textcolor{Blue
}{true
}}\textcolor{BrickRed
}{;
} \\
18 \mbox{}\ \
\textcolor{Red
}{\
}} \\
19 \mbox{}\ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ i
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{3}\textcolor{BrickRed
}{;
}\ i
\textcolor{BrickRed
}{*
}i
\textcolor{BrickRed
}{$<$=
}SIZE
\textcolor{BrickRed
}{;
}\ i\
\textcolor{BrickRed
}{+=
}\
\textcolor{Purple
}{2}\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
20 \mbox{}\ \ \ \
\textbf{\textcolor{Blue
}{if
}}\
\textcolor{BrickRed
}{(!
}criba
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{])
}\textcolor{Red
}{\
{} \\
21 \mbox{}\ \ \ \ \ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ j
\textcolor{BrickRed
}{=
}i
\textcolor{BrickRed
}{*
}i
\textcolor{BrickRed
}{;
}\ j
\textcolor{BrickRed
}{$<$=
}SIZE
\textcolor{BrickRed
}{;
}\ j\
\textcolor{BrickRed
}{+=
}\ i
\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
22 \mbox{}\ \ \ \ \ \ \ \ criba
\textcolor{BrickRed
}{[}j
\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{=
}\
\textbf{\textcolor{Blue
}{true
}}\textcolor{BrickRed
}{;
} \\
23 \mbox{}\ \ \ \ \ \
\textcolor{Red
}{\
}} \\
24 \mbox{}\ \ \ \
\textcolor{Red
}{\
}} \\
25 \mbox{}\ \
\textcolor{Red
}{\
}} \\
26 \mbox{}\textcolor{Red
}{\
}} \\
28 } \normalfont\normalsize